package com.gcd.gym.model;


import com.baomidou.mybatisplus.annotation.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

@Getter
@Setter
@TableName("admin")
public class Admin {

    @NotNull(message = "用户ID不能为空")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;


    @TableField(condition = SqlCondition.LIKE)
    @NotBlank(message = "手机号码不能为空")
    @Length(min = 11, max = 11, message = "手机号只能为11位")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
    private String phone;


    @TableField(condition = SqlCondition.LIKE)
    @NotBlank(message = "用户名不能为空")
    private String name;
    private String password;
}
